﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="BillEditor.aspx.cs" Inherits="WebRoot.BillEditor" %>
<%@ MasterType VirtualPath="~/Site.Master" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">

    <asp:UpdatePanel ID="NewPayee_AjaxPanel" runat="server"
        UpdateMode="Conditional" ChildrenAsTriggers="false">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="AddPayee" EventName="Click" />
        </Triggers>
        <ContentTemplate>
            <aspext:ModalPopupExtender ID="NewPayee_PopupExtender" runat="server"
                Drag="true" DropShadow="true" RepositionMode="RepositionOnWindowResizeAndScroll"
                CancelControlID="CancelButton" PopupDragHandleControlID="DragHandle"
                PopupControlID="NewPayeePanel" TargetControlID="PopupTrigger">
            </aspext:ModalPopupExtender>

            <asp:Button ID="PopupTrigger" runat="server"
                Text="PopupTrigger" Style="display:none;" />

            <asp:Panel ID="NewPayeePanel" runat="server"
                CssClass="popupPanel">
                <asp:Panel ID="DragHandle" runat="server">
                    Create New Payee
                </asp:Panel>
                <fieldset style="border:none;">
                    <asp:Label ID="lblPayeeName" runat="server"
                        AssociatedControlID="PayeeName" Width="110px"
                        Text="Payee Name:" />
                    <asp:TextBox ID="PayeeName" runat="server"
                        Width="200px" />

                    <br clear="all" />

                    <asp:Label ID="lblPayeeDescription" runat="server"
                        AssociatedControlID="PayeeDescription" Width="110px"
                        Text="Description:" />
                    <asp:TextBox ID="PayeeDescription" runat="server"
                        Width="200px" />

                    <br clear="all" />

                    <asp:Label ID="lblPayeeWebsite" runat="server"
                        AssociatedControlID="PayeeWebsite" Width="110px"
                        Text="Website:" />
                    <asp:TextBox ID="PayeeWebsite" runat="server"
                        Width="200px" />

                    <br clear="all" />

                    <asp:Button ID="SavePayee" runat="server"
                        Text="Save" OnClick="SavePayee_Click" />

                    <asp:Button ID="CancelButton" runat="server"
                        Text="Cancel" />
                </fieldset>
            </asp:Panel>        
        </ContentTemplate>    
    </asp:UpdatePanel>

    <asp:UpdatePanel ID="FormContainer_AjaxPanel" runat="server"
        UpdateMode="Conditional" ChildrenAsTriggers="false">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="SavePayee" EventName="Click" />
            <asp:PostBackTrigger ControlID="SaveButton" />
        </Triggers>
        <ContentTemplate>
            <asp:Panel ID="FormContainer" runat="server"
                Width="100%">
                <fieldset style="border: 1px solid black;display:block;width:860px;">
                    <asp:Label ID="lblPayee" runat="server"
                        AssociatedControlID="Payees" Width="125px"
                        Text="Payee:" />
                    <asp:DropDownList ID="Payees" runat="server"
                        Width="185px" />
                    <asp:ImageButton ID="AddPayee" runat="server"
                        ImageUrl="~/Images/Icons/GreenAdd.png" 
                        OnClick="AddPayee_Click" />            

                    <br clear="all" />
                    <br clear="all" />

                    <asp:Label ID="lblDescription" runat="server"
                        AssociatedControlID="Description" Width="125px"
                        Text="Description:" />
                    <asp:TextBox ID="Description" runat="server"
                        Width="250px" />

                    <asp:Label ID="lblPaymentType" runat="server"
                        AssociatedControlID="PaymentType" Width="130px"
                        Text="Payment Type:" />
                    <asp:DropDownList ID="PaymentType" runat="server"
                        Width="204px" /> 

                    <br clear="all" />

                    <asp:Label ID="lblDueDate" runat="server"
                        AssociatedControlID="DueDate" Width="125px"
                        Text="Due Date:" />            
                    <aspext:CalendarExtender ID="DueDateExtender" runat="server"
                        TargetControlID="DueDate" Animated="true" Format="dd MMM yyyy">
                    </aspext:CalendarExtender>
                    <asp:TextBox ID="DueDate" runat="server" 
                        Width="250px" />

                    <asp:Label ID="lblAmountDue" runat="server"
                        AssociatedControlID="AmountDue" Width="130px"
                        Text="Amount Due:" />
                    <asp:TextBox ID="AmountDue" runat="server"
                        Width="200px" />

                    <br clear="all" />

                    <span style="float:right;padding:20px 10px 0 0;">
                        <asp:Button ID="SaveButton" runat="server"
                            CssClass="FormButton" Text="Add Bill"
                            Width="100px" Height="25px" OnClick="SaveButton_Click" />
                    </span>
                </fieldset>
            </asp:Panel>        
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
